package operation;

import book.Book;
import book.BookList;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86131
 * Date: 2024-02-20
 * Time: 15:50
 */
public class ShowOperation implements IOperation{
    @Override  //接口重写方法
    public void work(BookList bookList) {
        System.out.println("显示图书");

        int currenSize = bookList.getUsedSize(); //得到书架的图书数量
        for (int i = 0; i < currenSize; i++) {
            Book book = bookList.getBook(i);
            System.out.println(book);
        }
    }
}
